package org.scs.carleton.ca.pgdt.core.internal.parser;

import org.scs.carleton.ca.pgdt.core.parser.nodes.IASTVariable;
import org.scs.carleton.ca.pgdt.core.visitor.PrologVisitor;

/**
 * Physical manifestation of a variable
 * 
 * @author tessierj
 *
 */
public class ASTVariable extends ASTNode implements IASTVariable {
	private String name;
	
	public ASTVariable(ASTTranslationUnit translationUnit, int type, String name) {
		super(translationUnit, type);
		this.name = name;
	}

	@Override
	public String getVariableName() {
		return name;
	}
	
	@SuppressWarnings("nls")
	public String toString() {
		return "Variable: " + name + " from " + getStartOffset() + " to " + getEndOffset();
	}
	
	@Override
	public boolean accept(PrologVisitor visitor) {
		return visitor.visit(this);
	}
}
